package cn.bdqn.dao.impl;

import cn.bdqn.dao.DistrictDao;
import cn.bdqn.entity.District;
import cn.bdqn.util.DataSourceUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

<<<<<<< HEAD
/**
 * 区域dao层的实现类
 * Created by Lenovo on 2018/10/9.
 */
public class DistrictDaoImpl implements DistrictDao {
    private QueryRunner qr = new QueryRunner(DataSourceUtil.getDataSource());
   //查询全部区域信息
    @Override
    public List<District> findAll() throws SQLException {
        String sql = "SELECT * FROM dictrict";
=======

public class DistrictDaoImpl implements DistrictDao {

    private QueryRunner qr = new QueryRunner(DataSourceUtil.getDataSource());



    //查询全部区域信息
    @Override
    public List<District> findAll() throws SQLException {
        String sql = "select * from district";
>>>>>>> 8401facf80807854843aea47729c77b70fec9b79
        List<District> list = qr.query(sql, new BeanListHandler<District>(District.class));
        return list;
    }
}
